/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.concurrent.TimeUnit;

/**
 * <p>Project: jse2302 - T6
 * <p>Powered by webrx On 2023-06-30 08:54:19
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class T6 {
    public static void main(String[] args) {
        var n1 = new Thread(T6::show,"A");
        var n2 = new Thread(T6::show,"B");
        var n3 = new Thread(T6::show,"C");
        n3.start();
        n2.start();
        n1.start();
    }

    static void show(){
        while(true){
            try{
                //Thread.sleep(5000);
                TimeUnit.SECONDS.sleep(5);
            }catch(Exception e){
                e.printStackTrace();
            }
            String t = Thread.currentThread().getName();
            System.out.printf("%s%n",t);
        }
    }
}
